{extend name="/fool" /}
{block name="css"}
<link rel="stylesheet" href="/css/admin/product_list.css">
<style>
    .layui-form-onswitch{
        /*background: #1989FA;*/
        /*border-color: #1989FA;*/
    }
    .layui-upload-img{
        height:200px;
        width:200px;
        margin: 10px;
    }
    .value{
        text-align: left;
    }
    .dt{
        width:200px;
        height:200px;
    }
</style>
{/block}
{block name="menu_content"}
<form class="layui-form" action="" method="post" enctype="multipart/form-data">
    <ul id="content" style="margin:100px;">
        <li class="li">
            <table class="one">
                <tr>
                    <td class="one-one">商铺名称：</td>
                    <td class="value">
                        <div class="layui-input-inline">
                            <input type="text" name="name" value="{$list.name}" autocomplete="off" class="layui-input" placeholder="输入商品名称">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">商品封面图：</td>
                    <td class="value">
                        <div class="layui-upload">
                            <button type="button" class="layui-btn" id="test1">上传图片</button>
                            <div class="layui-upload-list">
                                <input type="hidden" id="image" name="img">
                                <img class="layui-upload-img" id="demo1" src="{$list.img}">
                                <p id="demoText">
                                </p>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">商铺地址：</td>
                    <td class="value">
                        <div class="layui-input-inline">
                            <input type="text" name="address" value="{$list.address}" autocomplete="off" class="layui-input" placeholder="输入地址">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">营业时间：</td>
                    <td class="value">
                        <div class="layui-input-inline">
                            <input type="text" name="date" value="{$list.date}" autocomplete="off" class="layui-input" placeholder="输入商品名称">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">商铺介绍：</td>
                    <td class="value">
                        <script id="container" name="content" type="text/plain">
                        	{$list.content|raw}
                        </script>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">是否开店运营：</td>
                    <td class="value">
                        <div style="margin-left:0;" class="layui-input-block">
                        	{if $list.status == 1}
                            <input type="radio" name="status" value="1" title="是" checked>
                            <input type="radio" name="status" value="2" title="否">
                            {else}
                            <input type="radio" name="status" value="1" title="是">
                            <input type="radio" name="status" value="2" title="否" checked>
                            {/if}
                        </div>
                    </td>
                </tr>
                <tr>
                	<td class="one-one">经度坐标</td>
                	<td>
				        <div>
				            <input name="jwd" placeholder="73-135左右的为经度" value="" class="layui-input" style="width:300px;" lay-verify="required">
				        </div>
                	</td>
                </tr>
                <tr>
                	<td class="one-one">纬度坐标</td>
                	<td>
				        <div>
				            <input name="jwd" placeholder="3-53左右的为纬度" value="" class="layui-input" style="width:300px;" lay-verify="required">
				        </div>
                	</td>
                </tr>
                <tr>
                	<td colspan="2">
    					<iframe src="https://lbs.qq.com/tool/getpoint/index.html" style="width:1300px;overflow: auto;height:700px;margin-left: 100px;"></iframe>
                	</td>
                </tr>
                <tr>
                    <td class="one-one">
                        <button type="button" class="listbu layui-btn">取消</button>
                    </td>
                    <td class="value">
                        <button type="submit" class="fh layui-btn">保存</button>
                    </td>
                </tr>
            </table>
        </li>
    </ul>
</form>
<!-- 配置文件 -->
<script type="text/javascript" src="/utf8-php/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/utf8-php/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        initialFrameHeight: 300,
        initialFrameWidth: 700
    });
</script>
<script>
    $(".dtqx").click(function(){
        var id = $(this).attr('sid');
        $(this).closest(".imgdtdiv").hide();
        $.post("{:url('atlas/delete')}",{id},function(date){console.log(date)},'json');
    })

    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
    $(".listbu").click(function(){
        // history.back(-1);
        location.href = "{:url('index')}"
    })
    layui.use(['upload','jquery'], function(){
        var $ = layui.jquery;
        var upload = layui.upload;
        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: "{:url('images')}"
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                console.log(res);
                $("#image").val(res);
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>
{/block}